package frame;

import java.awt.Dimension;
import java.awt.Font;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.lang.reflect.InvocationTargetException;
import java.util.List;

import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableModel;

import dao.DEPTdao;
import entity.Department;

public class OutsideView extends JFrame implements ActionListener{
	
	
	public OutsideView() {
		
		setSize(600, 600);
		setResizable(false);
		setLayout(null);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		Dimension di=Toolkit.getDefaultToolkit().getScreenSize();
		setLocation((di.width-600)/2, (di.height-600)/2);
		setVisible(true);
		setTitle("院系学生表");
		DefaultTableModel dtm=new DefaultTableModel(new Object[][]{},new String[]{"studentname","studenid","studentaddress"});
		
		JTable maintable=new JTable(dtm);
		maintable.setSize(500,300);
		maintable.setLocation(50,200);
		add(maintable);
		
		
		JLabel label=new JLabel("当前院系是");
		Font font=new Font("微软雅黑", Font.TRUETYPE_FONT, 20);
		label.setFont(font);
		label.setLocation(50, 50);
		label.setSize(100, 20);
		add(label);
		String name[]={"math","computer","science"};
		JComboBox jcb=new JComboBox<>(name);
		jcb.setSize(200,20);
		jcb.setLocation(200, 50);
		add(jcb);
		
		
		
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		
		
	}
	public static void main(String[] args) {
		try {
			SwingUtilities.invokeAndWait(new Runnable() {
				public void run() {
					new OutsideView();
				}
			});
		} catch (InvocationTargetException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
}
